﻿/********************************************************************************
** @ Date:2024/07/03
** @ Author: WeiXiaoYu
** @ Description: 图片下载类
** @ Version:1.0.0
** @ Fun:
********************************************************************************/
#ifndef CIMAGEDOWNLOADER_H
#define CIMAGEDOWNLOADER_H
#include <QObject>

class QLabel;
class QNetworkAccessManager;
class QPixmap;
class CPdfAiPicPolygonArea;
class CImageDownloader : public QObject
{
    Q_OBJECT
public:
    CImageDownloader(QLabel* label, const QString& imageUrl, QObject* parent = nullptr);
	CImageDownloader(const QString& imageUrl, QObject* parent = nullptr);
    ~CImageDownloader();

public:
	void getNewDlPixmap(QPixmap &NewPixmap);//获取最新下载的Pixmap
	void getNewDlPixmap(QPixmap &NewPixmap, QVector<CPdfAiPicPolygonArea> vecPdfAiPicPolygonArea, double dImageWid, double dImageHig);//获取最新下载的Pixmap


private slots:
    void slotOnImageDownloaded();
	
private:
    QLabel* m_imageLabel = nullptr;
    QNetworkAccessManager* m_networkManager = nullptr;
	QString m_sImageUrl;
};

#endif // CIMAGEDOWNLOADER_H
